This invention relates in general to fonts used in a printer and, more particularly, to a system and method for managing font data for a print job by printer driver software.
Often a True Type font used in a document is not part of the standard set of True Type fonts found in a printer. Therefore, the True Type font must be downloaded to the printer before it may be printed. Downloading the font involves sending to the printer most of the standard tables in a True Type font as well as individual glyph definitions used to draw characters referenced in the text of the document. The amount of data in True Type tables that is required by the True Type rasterizer in the printer can exceed 30 Kilobytes for Latin based fonts or 1 Megabyte for Asian fonts. If a document references tens of True Type fonts, the amount of data becomes substantial and must be adequately managed.
Print jobs are often passed to printer drivers one graphic element at a time. Printer drivers are software modules that provide an interface typically between an operating system (OS) element (in Windows, a graphics device interface or GDI) and a printer connected to the computer. The purpose of a printer driver is to receive from the operating system, elements to print and to translate them to a language understood by the printer. The data associated with each element passed to the printer driver, for example a text string and its associated font, is often only valid within the context of the current GDI call to the driver.
Some printer drivers now support deferred printing where the rendering (translation to printer language) of a given graphic is delayed to a context (i.e. time) different than the context the graphic elements are sent in. However, generally it is not possible to retrieve font data from a host system outside of context of the Windows GDI call in which the text and font reference is passed. This is particularly true in Windows NT 4.0 printer drivers. One possible solution to this problem is to cache all font data explicitly and entirely for each reference to each font used in the print job. However as discussed above, this could take up quite a lot of memory. When memory is in high demand, storing all of the font data for all of the fonts in a print job is not an adequate solution.
According to principles of the present invention, a method and a system are used to manage fonts in print jobs with more than one context where at least some of the contexts include text strings. Print jobs may be divided into portions, called contexts, for example, pages, so that they are easier for a print manager to manage. These larger contexts, i.e. groupings of individual job elements, are herein referred to as graphic sets. Each of these graphic sets is sent to the printer driver consecutively. Each text string has a font associated with it. The font data for each text string is read from the operating system (OS) and cached into memory at the time each string is received by the printer driver. After all individual text string elements of a given graphic set have been received by the printer driver, the context is stored and the cached fonts are stored with the context. After all of the contexts of the print job have been received by the printer and stored, each context is restored and rendered. The graphic sets may be restored (i.e. played back) in any order. The fonts stored with a context are also restored when the context is restored.
According to further principles of the present invention, information that is determined to no longer be needed is purged after the font information is stored and before the next context is received by the printer. Cached font information is also purged after each print job graphic set has been played back and rendered.
Other objects, advantages, and capabilities of the present invention will become more apparent as the description proceeds.